home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11222 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  954 b 

  1. Path: ssbunews.ih.att.com!news
  2. From: Mark Slater <mslater@mltsa.mlm.att.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Q: default copy constructor
  5. Date: Wed, 13 Mar 1996 08:43:33 +0000
  6. Organization: AT&T
  7. Message-ID: <31468AB5.41C67EA6@mltsa.mlm.att.com>
  8. References: <4i49tj$991@azure.acsu.buffalo.edu>
  9. NNTP-Posting-Host: rumpole.mlm.att.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4c)
  14.  
  15. Li Chen wrote:
  16. > Hi, everyone:
  17. > Ihave a question:does a C++ compiler generate copy constructor
  18. > if there is none in the program?
  19. > Thank you.
  20. > David
  21. > --
  22. > ___________________________________________________________________________
  23. > ---------------------------------------------------------------------------
  24. > David Li Chen
  25.  
  26. Yes, but this will only be a shallow copy which can cause you memory
  27. problem later. It's best always to define your own.
  28.